********************************************************************************
*Project:  	Swiss Trade During the Covid-19 Pandemic: An Early Appraisal	
*Authors:	KB, SL, VP, PW											
*This File: Figure 4
*Version: 	vFinal						
*Date: 		2020-09-01		
********************************************************************************

********************************************************************************
*1. Cumulative Imports and Exports Comparison with Previous Years
********************************************************************************


*TIME SERIES 
use "${root}\workfiles\trade_2002_2020_M_analysis_wide.dta", replace

keep if SAMPLE==99

foreach ht in export import {
	foreach adj in "" "_a" "_s" "_t" {
		gen `ht'_tonnenMIO`adj'=`ht'_tonnen`adj'/(1000*1000)
	}
}

graph twoway 																	///
(line export_chf_mia_s datum if datum>=tm(2005m1), lcolor(gs2) lwidth(medium))		///
(line import_chf_mia_s datum if datum>=tm(2005m1), lcolor(gs10) lwidth(medium)),	///
ytitle("Billion CHF") 					///
xtitle("Year", margin(small)) yscale(range (11 22))	xscale(range(540 721))				///
tline(2008m9 2020m3, lcolor(maroon) lwidth(medium)) 							///
tline(2007m9 2019m3, lcolor(maroon) lwidth(thin) lpattern(shortdash))							///
ttext(12.4 2019m11 "COVID-19: Lockdown", place(e) size(vsmall) orient(vertical) color(maroon))  ///
ttext(13 2008m5 "Bankruptcy Lehman Brothers", place(e) size(vsmall) orient(vertical) color(maroon))  ///
ttext(21.5 2019m4 "1 year", place(e) size(vsmall) orient(horizontal) color(maroon))  ///
ttext(21.5 2007m10 "1 year", place(e) size(vsmall) orient(horizontal) color(maroon))  ///
ylabel(, format(%5.0f))	xlabel(, format(%tmCCYY) labsize(vsmall)) xlabel(#16)		///
legend(order (1 "Exports" 2 "Imports"))		///
scheme(s1color) 
graph export "${root}\figures\FIG4_export_import_CHF_S_2005_2021.png", replace
graph export "${root}\figures\FIG4_export_import_CHF_S_2005_2021.pdf", replace




